package com.zzg.springboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.zzg.springboot.dao.UserDao;
import com.zzg.springboot.dao.UserMapDao;
import com.zzg.springboot.entity.User;
import com.zzg.springboot.entity.UserMap;



@Controller
@RequestMapping("/api/springboot")
public class UserController {
	@Autowired
	private UserDao dao;
	@Autowired
	private UserMapDao userMapDao;

	
	@RequestMapping(value="/one",method={RequestMethod.GET})
	@ResponseBody
	public User one(@RequestParam long id){
		return dao.getUserEntityById(id);
	}
	
	@RequestMapping(value="/two",method={RequestMethod.GET})
	@ResponseBody
	public User two(@RequestParam long id){
		return dao.getSetById(id);
	}
	
	@RequestMapping(value="/three",method={RequestMethod.GET})
	@ResponseBody
	public UserMap three(@RequestParam long id){
		return userMapDao.getMapById(id);
	}
	
}
